package com.xiangge.demo;

import java.util.*;

public class OOPDemo2 {
    static int num;
    static {
        System.out.println("静态代码块执行num" + ++num);
    }
    {
        System.out.println("构造代码块执行num" + ++num);
    }
    public OOPDemo2(){
        System.out.println("无参构造方法执行num" + ++num);
    }
    public OOPDemo2(int num){
        this();
        System.out.println("有参构造方法执行num" + ++num);
    }


    public static void main(String[] args) {
        new OOPDemo2(3);
        new OOPDemo2();
    }
}


